Skip to main content

CreateMasterSlaveServerGroup

Description

call CreateMasterSlaveServerGroup to create a primary and standby server group. A primary and standby server group can only contain two ECS instances, one is the primary server and the other is the standby server.

Request Method

POST

Request Path

/apsara/route/Slb/CreateMasterSlaveServerGroup

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
regionIdBODYstringYesNo sample value for this parameter.region id
LoadBalancerIdBODYstringYeslb-bp1hv944r69al4j****load balancing instance ID.
RegionIdBODYstringYescn-qingdao-env17-d01the region ID of the load balancing instance.
MasterSlaveServerGroupNameBODYstringNosg-atstuj3rtopty****primary and standby virtual server group name.
MasterSlaveBackendServersBODYstringNo[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","ServerType":"Master","Description":"test-112" }, { "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","ServerType":"Slave","Description":"test-112" }]list of primary and standby server groups. Value: is a Json string, and its structure is a JsonList. In a request, the list supports up to 20 elements. ServerId:String type, required, backend server instance ID. Port:Integer type, required, port used by backend server, value range:1~65535. Weight:Integer type, required, weight of backend server, value range:0~100. Description :String type, optional, backend server description, 1-80 characters in length, allow letters, numbers, dashes (-), forward slashes (/), half-width periods (.), and underscores (_). Support Chinese. ServerType:String type, indicating the primary and standby type of the backend server, value: Master: main server. Slave: standby server. Type:String type, indicating the instance type of the backend server, value: ecs(default):ECS instance. eni: ENI instance. ServerIp: instance IP of ECS or ENI. A primary and standby server group can contain up to 2 backend servers. if this parameter is not specified, create an empty list of primary and standby server groups. The example is as follows: mount ECS:[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "ServerType": "Master", "Description": "test-112" }, { "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "ServerType": "Slave", "Description": "test-112" }] mount ENI:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "Port": "80", "ServerType": "Master", "Description": "test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "ServerType": "Slave", "Description": "test-112" }] mount ENI multi-IP:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "ServerType": "Master", "Description": "test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "ServerType": "Slave", "Description": "test-112" }]
versionBODYstringNo2016-01-01version of api

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}

title: CreateVServerGroup

CreateVServerGroup

Description

call CreateVServerGroup to add a backend server group and add a backend server to the specified backend server group.

Request Method

POST

Request Path

/apsara/route/Slb/CreateVServerGroup

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
regionIdBODYstringYesNo sample value for this parameter.region id
VServerGroupNameBODYstringNoGroup1virtual server group name. is limited to 1 to 80 characters in length. Only Chinese characters, letters, numbers, dashes (-), forward slashes (/), periods (.), and underscores (_) are allowed.
LoadBalancerIdBODYstringYeslb-bp1qjwo61pqz3ahl****load balancing instance ID.
RegionIdBODYstringYescn-qingdao-env17-d01load balancing region ID.
BackendServersBODYstringNo[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.XX.XX. 6", "Port":"80","Description":"test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.XX.XX. 6", "Port":"80","Description":"test-112" }]list of back-end servers to be added. Value: is a Json string, and its structure is a JsonList. In a request, the maximum number of elements in the List is 20. ServerId:String type, required, backend server instance ID, ECS instance ID or ENI instance ID. Port:Integer type, required, port used by backend server, value range:1~65535. Weight:Integer type, required, weight of backend server, value range:0~100. Description :String type, optional, backend server description, 1-80 characters in length, allow letters, numbers, dashes (-), forward slashes (/), English periods (.), and underscores (_). Chinese is supported. Type:String type, required, indicating the instance type of the backend server, value: ecs(default):ECS instance. eni: ENI instance. ServerIp: instance IP of ECS or ENI. The example is as follows: example of mounting ECS:[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "Description": "test-112" }] mount ENI:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" }] mount ENI multi-IP:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port": "80", "Description": "test-113" }]
versionBODYstringNo2016-01-01version of api

Return data

NameTypeSample valueDescription
VServerGroupIdstringrsp-cige6****backend server group ID.
ServerTypestringECSNo description for this parameter.
TypestringTypebackend server type, value: ecs(default):ECS instance. eni: ENI instance.
ServerIdstringvm-2****ECS instance ID or ENI instance ID.
Descriptionstringbackend server groupbackend server group description.
RequestIdstring9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18Crequest ID.
BackendServerNo sample value for this parameter.No description for this parameter.
Portinteger70the port used by the backend server.
BackendServersarray of backendserverNo sample value for this parameter.backend server list.
Weightinteger100the weight of the back-end server.

Example

Successful Response example

{
"VServerGroupId":"rsp-cige6****",
"ServerType":"ECS",
"Type":"Type",
"ServerId":"vm-2****",
"Description":"backend server group",
"RequestId":"9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
"BackendServer":"",
"Port":"70",
"BackendServers":"",
"Weight":"100"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}